package com.xbongbong.workflow.feign;

import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.workflow.pojo.workorderv2.dto.WorkflowUpdateDataDTO;
import com.xbongbong.workflow.pojo.workorderv2.dto.WorkflowWorkOrderV2ApprovalFailedDTO;
import com.xbongbong.workflow.pojo.workorderv2.dto.WorkflowWorkOrderV2SaveDTO;
import com.xbongbong.workflow.pojo.workorderv2.dto.WorkflowWorkOrderV2UpdateBackDTO;
import com.xbongbong.workflow.pojo.workorderv2.dto.WorkflowWorkOrderV2UpdateDTO;
import com.xbongbong.workflow.pojo.workorderv2.vo.WorkflowWorkOrderV2ApprovalFailedVO;
import com.xbongbong.workflow.pojo.workorderv2.vo.WorkflowWorkOrderV2SaveVO;
import com.xbongbong.workflow.pojo.workorderv2.vo.WorkflowWorkOrderV2UpdateBackVO;
import com.xbongbong.workflow.pojo.workorderv2.vo.WorkflowWorkOrderV2UpdateVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 吴峰
 * @date 2022/11/11 16:59
 */
@FeignClient(name = "xbb-work-order-web")
public interface WorkflowWorkOrderV2FeignClient {

    @RequestMapping(value = "/pro/v1/workOrderV2/workflow/saveAfterWorkflow", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    XbbResponse<WorkflowWorkOrderV2SaveVO> saveAfterWorkflow(@RequestBody WorkflowWorkOrderV2SaveDTO saveDTO, @RequestParam("lang") String lang);

    @RequestMapping(value = "/pro/v1/workOrderV2/workflow/updateAfterWorkflow", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    XbbResponse<WorkflowWorkOrderV2UpdateVO> updateAfterWorkflow(@RequestBody WorkflowWorkOrderV2UpdateDTO updateDTO, @RequestParam("lang") String lang);

    @RequestMapping(value = "/pro/v1/workOrderV2/workflow/updateBack", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    XbbResponse<WorkflowWorkOrderV2UpdateBackVO> updateBack(@RequestBody WorkflowWorkOrderV2UpdateBackDTO updateBackDTO, @RequestParam("lang") String lang);

    @RequestMapping(value = "/pro/v1/workOrderV2/workflow/approvalFailed", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    XbbResponse<WorkflowWorkOrderV2ApprovalFailedVO> approvalFailed(@RequestBody WorkflowWorkOrderV2ApprovalFailedDTO approvalFailedDTO, @RequestParam("lang") String lang);


    /**
     * 更新工单数据
     * @param workflowUpdateDataDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/workflow/updateData", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    XbbResponse<BaseVO> updateData(@RequestBody WorkflowUpdateDataDTO workflowUpdateDataDTO, @RequestParam("lang") String lang);
}
